package controladores;

import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import vistas.VistaPrincipal;

/**
 * @author Shidobu
 */
public class ControladorPrincipal
{
	private VistaPrincipal vista;

	public ControladorPrincipal () {
	}

	public void reiniciar () {
		salir ();
		iniciar ();
	}

	public void salir () {
		vista.dispose ();
		vista = null;
	}

	public void iniciar () {
		vista = new VistaPrincipal (this);
		vista.setVisible (true);
	}

    /**
     * @param args the command line arguments
     */
    public static void main (String[] args)
	{
        JFrame.setDefaultLookAndFeelDecorated(true);
        JDialog.setDefaultLookAndFeelDecorated(true);

        SwingUtilities.invokeLater(new Runnable() {
        public void run() {
        try {
          //UIManager.setLookAndFeel("org.jvnet.substance.skin.SubstanceMistAquaLookAndFeel");
          ControladorPrincipal controlador = new ControladorPrincipal ();
	  controlador.iniciar ();
            }
        catch (Exception e) {
          System.out.println("No se cargo look and feel");
        }   
      }
    });//Fin invokelater
  }

			
	

}
